package com.sh.data.engine.domain.datadev.flink.model.domain;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author: zigui.zdf
 * @description:
 * @date: 2021/6/4 10:34
 */
@Data
//@ApiModel
public class SaveSourceDomain {

    //    @ApiModelProperty(value = "节点id")
    @NotNull(message = "节点id不能为空")
    private Long nodeId;

    //    @ApiModelProperty(value = "来源配置")
    private List<Source> sources;

    @Data
//    @ApiModel
    public static class Source {
        /**
         * 数据源类型
         */
        //    @ApiModelProperty(value = "数据源类型")
        @NotBlank(message = "数据源类型不能为空")
        private String dsType;

        /**
         * 数据源id
         */
        //    @ApiModelProperty(value = "数据源id")
        @NotNull(message = "数据源id不能为空")
        private Long dsId;

        //    @ApiModelProperty(value = "分区")
        private List<FlinkKafkaSourceConfigDomain.PartitionOffset> partitionOffsetList;

        /**
         * 映射表
         */
        //    @ApiModelProperty(value = "映射表")
        @NotBlank(message = "映射表不能为空")
        private String mappingTableName;

        /**
         * 映射字段
         */
        //    @ApiModelProperty(value = "映射表字段")
        private List<FlinkFieldDomain> fieldList;

        /**
         * 并行度
         */
        //    @ApiModelProperty(value = "并行度")
        private Integer parallel;

        //    @ApiModelProperty(value = "kafka类型的源配置")
        private KafkaSourceDomain kafkaSource;
    }
}
